<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <title>White Noise Generator | White Noise Machine</title>
    <meta name="description"
          content="Chill out and Relax using OnlineClock.net's free Online White Noise Generator! Soothing Sounds to help you Work, Study & Sleep better!">
    <link rel="canonical" href="https://onlineclock.net/noisegenerator/">
    <meta property="og:image" content="https://onlineclock.net/noisegenerator/white-noise-generator.jpg">

    <meta name="twitter:card" content="summary">
    <meta name="twitter:site" content="@onlineclock">
    <meta name="twitter:title" content="White Noise Generator">
    <meta name="twitter:description"
          content="Chill out and relax using OnlineClock.net's free Online White Noise Generator. Ambient Sounds to help you work, live & sleep better!">
    <meta name="twitter:image:src" content="https://onlineclock.net/noisegenerator/white-noise-generator.jpg">

    <meta name="robots" content="index,follow,archive">
    <meta name="googlebot" content="index,follow,archive">
    <link rel="alternate" media="only screen and (max-width: 640px)" href="//m.onlineclock.net/noisegenerator/">
    <link rel="shortcut icon" href="https://onlineclock.net/online-clock.png">

    <script type="text/javascript">
        if (window.screen.width < 641) {
            window.location = "//m.onlineclock.net/noisegenerator/";
        }
    </script>

    <link rel="stylesheet" type="text/css" href="//onlineclock.net/noisegenerator/css/noisegen.css">
    <script src="//onlineclock.net/noisegenerator/javascript/noisegenerator-fab1.js" type="text/javascript"></script>
</head>
<body onLoad="show3();removeUnderline(1);removeUnderline2(5)" bgcolor="#000000" text="#666666" id="theBody">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td width="50%" valign="top">
            <div id="qm0" class="qmmc" style="z-index: 11; float: left;">
                <a href="//onlineclock.net/about/" title="Navigation" class="qmparent" target="_blank"><img alt="Menu"
                                                                                                            class="qm-is"
                                                                                                            src="//onlineclock.net/images/menu.png"
                                                                                                            width="16"
                                                                                                            height="16"
                                                                                                            border="0"></a>
                <div>
                    <span class="qmtitle">Online Alarm Clocks</span>
                    <a href="//onlineclock.net/" title="Online Alarm Clock" target="_blank">Online Alarm Clock</a>
                    <a href="//onlineclock.net/timezones/" title="Time Zone Clocks" target="_blank">Time Zone Clocks</a>
                    <a href="//military.onlineclock.net/" title="Military Time" target="_blank">Military Time</a>
                    <a href="//military.onlineclock.net/chart/" title="Military Time Converter" target="_blank">Military
                        Time Converter</a>
                    <a href="//analog.onlineclock.net/" title="Analog Alarm Clock" target="_blank">Analog Alarm
                        Clock</a>
                    <a href="//onlineclock.net/noisegenerator/" title="White Noise Generator" target="_blank">White
                        Noise Generator</a>
                    <a href="//onlineclock.net/video/" title="Video Alarm Clock" target="_blank">Video Alarm Clock</a>
                    <span class="qmdivider qmdividerx"></span>
                    <span class="qmtitle">Countdown Timers</span>
                    <a href="//countdown.onlineclock.net/" title="Countdown Timer" target="_blank">Countdown Timer</a>
                    <a href="//timer.onlineclock.net/" title="Online Timer" target="_blank">Online Timer</a>
                    <a href="//timer.onlineclock.net/timers/" title="Timers" target="_blank">Timers</a>
                    <a href="//countdown.onlineclock.net/generator/" title="Countdown Generator" target="_blank">Countdown
                        Generator</a>
                    <a href="//countdown.onlineclock.net/countdowns/" title="Popular Countdowns" target="_blank">Popular
                        Countdowns</a>
                    <a href="//counter.onlineclock.net/" title="Online Counter" target="_blank">Online Counter</a>
                    <a href="//task.onlineclock.net/" title="Task Timer" target="_blank">Task Timer</a>
                    <span class="qmdivider qmdividerx"></span>
                    <span class="qmtitle">Online Stopwatches</span>
                    <a href="//stopwatch.onlineclock.net/" title="Online Stopwatch" target="_blank">Online Stopwatch</a>
                    <a href="//stopwatch.onlineclock.net/alarm/" title="Stopwatch With Alarm" target="_blank">Stopwatch
                        With Alarm</a>
                    <a href="//stopwatch.onlineclock.net/games/" title="Stopwatch Games" target="_blank">Stopwatch
                        Games</a>
                    <span class="qmdivider qmdividerx"></span>
                    <span class="qmtitle">Fun Online Clocks</span>
                    <a href="//binary.onlineclock.net/" title="Binary Clock" target="_blank">Binary Clock</a>
                    <a href="//domino.onlineclock.net/" title="Domino Clock" target="_blank">Domino Clock</a>
                    <a href="//space.onlineclock.net/" title="Space Clock" target="_blank">Space Clock</a>
                    <a href="//barcode.onlineclock.net/" title="Barcode Alarm Clock" target="_blank">Barcode Alarm
                        Clock</a>
                    <a href="//circles.onlineclock.net/" title="Circles Clock" target="_blank">Circles Clock</a>
                    <a href="//words.onlineclock.net/" title="Word Alarm Clock" target="_blank">Word Alarm Clock</a>
                    <span class="qmdivider qmdividerx"></span>
                    <a href="//blog.onlineclock.net/" title="Alarm Clock Blog" target="_blank">Alarm Clock Blog</a>
                </div>&nbsp;&nbsp;
            </div>

            <script type="text/javascript">qm_create(0, false, 0, 500, false, false, false, false, false);</script>
            <a href="javascript:void(0);" onClick="changeImageSize(36,50,18,50);removeUnderline(0);" class="sizeLink"
               title="Small" id="lsmall">Small</a> | <a href="javascript:void(0);"
                                                        onClick="changeImageSize(72,100,36,100);removeUnderline(1);"
                                                        class="sizeLink" title="Medium" id="lmedium">Medium</a> | <a
                href="javascript:void(0);" onClick="changeImageSize(144,200,36,100);removeUnderline(2);"
                class="sizeLink" title="Large" id="llarge">Large</a> | <a href="javascript:void(0);"
                                                                          onClick="changeImageSize(180,250,36,100);removeUnderline(3);"
                                                                          class="sizeLink" title="X-Large" id="lxlarge">X-Large</a>
        </td>
        <td width="50%" align="right" valign="top">
            <a href="javascript:void(0);" onClick="changeBackground('blue');removeUnderline2(4);" class="sizeLink"
               title="Blue" id="lblue">Blue</a> | <a href="javascript:void(0);"
                                                     onClick="changeBackground('black');removeUnderline2(5);"
                                                     class="sizeLink" title="Black" id="lblack">Black</a> | <a
                href="javascript:void(0);" onClick="changeBackground('silver');removeUnderline2(6);" class="sizeLink"
                title="Silver" id="lsilver">Silver</a> | <a href="javascript:void(0);"
                                                            onClick="changeBackground('#006400');removeUnderline2(7);"
                                                            class="sizeLink" title="Green" id="lgreen">Green</a> | <a
                href="javascript:void(0);" onClick="changeBackground('orange');removeUnderline2(8);" class="sizeLink"
                title="Orange" id="lorange">Orange</a>
        </td>
    </tr>
</table>

<table align="center" width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
    <tr>
        <td align="center" valign="middle" width="100%" height="100%">

            <table border="0" cellspacing="4" cellpadding="4" align="center" width="100%" id="noiseGenDiv">
                <tr>
                    <td align="center" width="100%">
                        <img height="100" src="numerals/cb.gif" width="72" name="a" id="a"
                             alt="White Noise Hours">
                        <img height="100" src="numerals/cb.gif" width="72" name="b" id="b"
                             alt="White Noise Hours">
                        <img height="100" src="numerals/colon.gif" width="36" name="c" id="c" alt=":">
                        <img height="100" src="numerals/cb.gif" width="72" name="d" id="d"
                             alt="White Noise Minutes">
                        <img height="100" src="numerals/cb.gif" width="72" name="e" id="e"
                             alt="White Noise Minutes">
                        <img height="100" src="numerals/colon.gif" width="36" name="f" id="f" alt=":">
                        <img height="100" src="numerals/cb.gif" width="72" name="g" id="g"
                             alt="White Noise Seconds">
                        <img height="100" src="numerals/cb.gif" width="72" name="h" id="h"
                             alt="White Noise Seconds">
                        <img height="100" src="numerals/cam.gif" width="72" name="j" id="j"
                             alt="AM / PM">
                    </td>
                </tr>
                <tr>
                    <td align="center" valign="top">

                        <br><br>
                        <form name="thisForm" style="margin-top:0px; margin-bottom:0px;"
                              action="//onlineclock.net/noisegenerator/alarm.html" method="post">
                            <h1 style="color:#999999;font-weight:bold;font-size:14px;display:inline;">Noise Generator
                                Alarm Settings:</h1>
                    </td>
                </tr>
                <tr>
                    <td align="center">

                        <table border="0" cellspacing="0" cellpadding="0" align="center">
                            <tr>
                                <td align="center">
                                    <select name="alarm_hour" title="Alarm Hour" style="font-size:16px;"
                                            onChange="playQuietlyOrig();">
                                        <option value="">OFF</option>
                                        <option value="1" style="text-align: right;">&nbsp;&nbsp;1 AM</option>
                                        <option value="2" style="text-align: right;">&nbsp;&nbsp;2 AM</option>
                                        <option value="3" style="text-align: right;">&nbsp;&nbsp;3 AM</option>
                                        <option value="4" style="text-align: right;">&nbsp;&nbsp;4 AM</option>
                                        <option value="5" style="text-align: right;">&nbsp;&nbsp;5 AM</option>
                                        <option value="6" style="text-align: right;">&nbsp;&nbsp;6 AM</option>
                                        <option value="7" style="text-align: right;">&nbsp;&nbsp;7 AM</option>
                                        <option value="8" style="text-align: right;">&nbsp;&nbsp;8 AM</option>
                                        <option value="9" style="text-align: right;">&nbsp;&nbsp;9 AM</option>
                                        <option value="10" style="text-align: right;">10 AM</option>
                                        <option value="11" style="text-align: right;">11 AM</option>
                                        <option value="12" style="text-align: right;">12 PM</option>
                                        <option value="13" style="text-align: right;">&nbsp;&nbsp;1 PM</option>
                                        <option value="14" style="text-align: right;">&nbsp;&nbsp;2 PM</option>
                                        <option value="15" style="text-align: right;">&nbsp;&nbsp;3 PM</option>
                                        <option value="16" style="text-align: right;">&nbsp;&nbsp;4 PM</option>
                                        <option value="17" style="text-align: right;">&nbsp;&nbsp;5 PM</option>
                                        <option value="18" style="text-align: right;">&nbsp;&nbsp;6 PM</option>
                                        <option value="19" style="text-align: right;">&nbsp;&nbsp;7 PM</option>
                                        <option value="20" style="text-align: right;">&nbsp;&nbsp;8 PM</option>
                                        <option value="21" style="text-align: right;">&nbsp;&nbsp;9 PM</option>
                                        <option value="22" style="text-align: right;">10 PM</option>
                                        <option value="23" style="text-align: right;">11 PM</option>
                                        <option value="0" style="text-align: right;">12 AM</option>
                                    </select>
                                </td>
                                <td style="color:#FFFFFF;font-weight:900;" align="center">&nbsp;:&nbsp;</td>
                                <td align="center">
                                    <select name="alarm_minute" title="Alarm Minute" style="font-size:16px;"
                                            onChange="playQuietlyOrig();">
                                        <option value="0" style="text-align: right;">00</option>
                                        <option value="1" style="text-align: right;">01</option>
                                        <option value="2" style="text-align: right;">02</option>
                                        <option value="3" style="text-align: right;">03</option>
                                        <option value="4" style="text-align: right;">04</option>
                                        <option value="5" style="text-align: right;">05</option>
                                        <option value="6" style="text-align: right;">06</option>
                                        <option value="7" style="text-align: right;">07</option>
                                        <option value="8" style="text-align: right;">08</option>
                                        <option value="9" style="text-align: right;">09</option>
                                        <option value="10" style="text-align: right;">10</option>
                                        <option value="11" style="text-align: right;">11</option>
                                        <option value="12" style="text-align: right;">12</option>
                                        <option value="13" style="text-align: right;">13</option>
                                        <option value="14" style="text-align: right;">14</option>
                                        <option value="15" style="text-align: right;">15</option>
                                        <option value="16" style="text-align: right;">16</option>
                                        <option value="17" style="text-align: right;">17</option>
                                        <option value="18" style="text-align: right;">18</option>
                                        <option value="19" style="text-align: right;">19</option>
                                        <option value="20" style="text-align: right;">20</option>
                                        <option value="21" style="text-align: right;">21</option>
                                        <option value="22" style="text-align: right;">22</option>
                                        <option value="23" style="text-align: right;">23</option>
                                        <option value="24" style="text-align: right;">24</option>
                                        <option value="25" style="text-align: right;">25</option>
                                        <option value="26" style="text-align: right;">26</option>
                                        <option value="27" style="text-align: right;">27</option>
                                        <option value="28" style="text-align: right;">28</option>
                                        <option value="29" style="text-align: right;">29</option>
                                        <option value="30" style="text-align: right;">30</option>
                                        <option value="31" style="text-align: right;">31</option>
                                        <option value="32" style="text-align: right;">32</option>
                                        <option value="33" style="text-align: right;">33</option>
                                        <option value="34" style="text-align: right;">34</option>
                                        <option value="35" style="text-align: right;">35</option>
                                        <option value="36" style="text-align: right;">36</option>
                                        <option value="37" style="text-align: right;">37</option>
                                        <option value="38" style="text-align: right;">38</option>
                                        <option value="39" style="text-align: right;">39</option>
                                        <option value="40" style="text-align: right;">40</option>
                                        <option value="41" style="text-align: right;">41</option>
                                        <option value="42" style="text-align: right;">42</option>
                                        <option value="43" style="text-align: right;">43</option>
                                        <option value="44" style="text-align: right;">44</option>
                                        <option value="45" style="text-align: right;">45</option>
                                        <option value="46" style="text-align: right;">46</option>
                                        <option value="47" style="text-align: right;">47</option>
                                        <option value="48" style="text-align: right;">48</option>
                                        <option value="49" style="text-align: right;">49</option>
                                        <option value="50" style="text-align: right;">50</option>
                                        <option value="51" style="text-align: right;">51</option>
                                        <option value="52" style="text-align: right;">52</option>
                                        <option value="53" style="text-align: right;">53</option>
                                        <option value="54" style="text-align: right;">54</option>
                                        <option value="55" style="text-align: right;">55</option>
                                        <option value="56" style="text-align: right;">56</option>
                                        <option value="57" style="text-align: right;">57</option>
                                        <option value="58" style="text-align: right;">58</option>
                                        <option value="59" style="text-align: right;">59</option>
                                    </select>
                                    <INPUT TYPE="HIDDEN" NAME="mode" value="alarm" CHECKED></td>
                            </tr>
                        </table>


                        <section id="top_control">
                            <div class="mute_btn">
                                <a href="javascript:void(0);" title="Mute / Unmute">
                                    <i class="fa fa-volume-up unmuted" aria-hidden="true"></i>
                                    <i class="fa fa-volume-off muted" aria-hidden="true"></i>
                                </a>
                            </div>
                            <div class="reset_btn">
                                <a href="javascript:void(0);" title="Reset All">
                                    <i class="fa fa-refresh" aria-hidden="true"></i>
                                </a>
                            </div>
                        </section>
                        <section id="main">
                            <div class="sounds_container">

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/rain.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/rain.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/rain.png" alt="Rain Noise"><a class="play"
                                                                                                          href="javascript:void(0);"
                                                                                                          title="Rain Noise"></a>
                                    </div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/thunder.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/thunder.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/thunder.png" alt="Thunderstorm Noise"><a
                                            class="play" href="javascript:void(0);" title="Thunderstorm Noise"></a>
                                    </div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/forest.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/forest.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/forest.png" alt="Forest Noise"><a
                                            class="play" href="javascript:void(0);" title="Forest Noise"></a></div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/leaves.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/leaves.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/leaves.png" alt="Leaves in Wind Noise"><a
                                            class="play" href="javascript:void(0);"
                                            title="Leaves in the Wind Noise"></a></div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/drops.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/drops.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/drop.png" alt="Water Drop Noise"><a
                                            class="play" href="javascript:void(0);" title="Water Drop Noise"></a></div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/fire.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/fire.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/fire.png" alt="Fire Noise"><a class="play"
                                                                                                          href="javascript:void(0);"
                                                                                                          title="Fire Noise"></a>
                                    </div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/cat_purr.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/cat_purr.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/catpurr.png" alt="Purring Cat Noise"><a
                                            class="play" href="javascript:void(0);" title="Purring Cat Noise"></a></div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/sheep.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/sheep.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/sheep.png" alt="Sheep Noise"><a class="play"
                                                                                                            href="javascript:void(0);"
                                                                                                            title="Sheep Noise"></a>
                                    </div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/birds.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/birds.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/bird.png" alt="Birdsong Noise"><a
                                            class="play" href="javascript:void(0);" title="Birdsong Noise"></a></div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/beach.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/beach.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/beach.png" alt="Beach & Wave Noise"><a
                                            class="play" href="javascript:void(0);" title="Beach & Wave Noise"></a>
                                    </div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/river.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/river.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/river.png" alt="Running River Noise"><a
                                            class="play" href="javascript:void(0);" title="Running River Noise"></a>
                                    </div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/windchimes.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/windchimes.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/windchimes.png" alt="Windchime Noise"><a
                                            class="play" href="javascript:void(0);" title="Windchime Noise"></a></div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/pinknoise.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/pinknoise.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/pinknoise.png" alt="Pink Noise"><a
                                            class="play" href="javascript:void(0);" title="Pink Noise"></a></div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>

                                <div class="sound_block">
                                    <audio>
                                        <source src="//onlineclock.net/audio/noisegen/brownnoise.mp3" type="audio/mpeg">
                                        <source src="//onlineclock.net/audio/noisegen/brownnoise.ogg" type="audio/ogg">
                                    </audio>
                                    <div class="start_btn"><img src="images/brownnoise.png" alt="Brown Noise"><a
                                            class="play" href="javascript:void(0);" title="Brown Noise"></a></div>
                                    <input class="volume_bar" type="range" value="0" max="1" step="0.001">
                                </div>
                            </div>
                        </section>

                    </td>
                </tr>
            </table>
            </form>

        </td>
    </tr>
    <tr>
        <td align="center" valign="bottom">

            <center>&copy; 2006 - 2021 OnlineClock.net | <a href="//onlineclock.net/about/privacy.html#contact"
                                                            class="sizeLink">Contact</a> | <a
                    href="//onlineclock.net/about/" class="sizeLink">About</a> | <a
                    href="//onlineclock.net/about/privacy.html#privacy" class="sizeLink">Privacy</a> | <a
                    href="https://twitter.com/onlineclock" class="sizeLink" target="_blank"
                    title="Online Clock on Twitter">Twitter</a> | <a href="https://www.instagram.com/onlinealarmclock/"
                                                                     class="sizeLink" target="_blank"
                                                                     title="Online Clock on Instagram">Insta</a> | <a
                    href="https://www.facebook.com/onlineclock/" class="sizeLink" target="_blank"
                    title="Online Clock on Facebook">FB</a></center>
            <br>

        </td>
    </tr>
</table>


<script src="https://use.fontawesome.com/11fc9055ad.js" type="text/javascript"></script>
<script type="text/javascript">
    <!--
    /*
    The White Noise Generator function on this page (NOT the Clock, the Alarm function or anything else on this site): MIT License

    Copyright (c) 2017 Stefan Petrovic

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.
    */
    //DOM Elements with sound
    var all_sounds = document.querySelectorAll('audio');

    for (var i = 0; i < all_sounds.length; i++) {
        all_sounds[i].addEventListener("canplaythrough", loadedSounds, false);
        all_sounds[i].load();	// Force reload in case some audio files already loaded to avoid stuck loading screen
    }

    var loaded = 0;
    var percent = 0;

    function loadedSounds(e) {
        loaded++; // Increment loaded counter to check if all sounds can be played
        percent = Math.floor(100 * loaded / all_sounds.length); // Calculate percentage
        //document.querySelector('.load_status').innerText = percent+"%"; // Set textual percentage to load status
        //document.querySelector('.load_fill').style.width= percent+"%";

        //console.log(percent);
        if (loaded == all_sounds.length) {
            //alert('Loaded!');
            for (var i = 0; i < all_sounds.length; i++) {
                all_sounds[i].removeEventListener("canplaythrough", loadedSounds);
            }
            //setTimeout(fadeOutLoader, 1000);
        }
    }

    // DOM Elements that control play/stop sounds
    var play_btn = document.querySelectorAll('.play');

    // Adding listeners to every play/stop button
    for (var i = 0; i < play_btn.length; i++) {
        play_btn[i].addEventListener("click", playSound, false);
    }

    // DOM elements that controll sound volume
    var volume_control = document.querySelectorAll('.volume_bar');

    // Adding listeners to every volume control slider
    for (var i = 0; i < volume_control.length; i++) {
        volume_control[i].addEventListener("input", volumeSound, false);
        volume_control[i].style.opacity = 0;
    }

    // DOM element that mutes and unmutes the page
    var mute_btn = document.querySelector(".mute_btn a");
    var is_muted = false;
    mute_btn.addEventListener('click', muteDocument, false);

    // DOM element that resets the sounds
    var reset_btn = document.querySelector(".reset_btn a");
    reset_btn.addEventListener('click', resetSounds, false);

    // Controlling stoping and playing the sound
    function playSound(e) {
        if (is_muted) {
            muteDocument();
        }
        var targetElement = e.target || e.srcElement;
        var selectedSound = targetElement.parentElement.parentElement.querySelector('audio');
        var volumeControler = targetElement.parentElement.parentElement.querySelector('.volume_bar');
        var soundImage = targetElement.parentElement.parentElement.querySelector('img');

        if (selectedSound.paused) {
            volumeControler.style.opacity = 1;
            selectedSound.loop = true;
            if (volumeControler.value == 0) {
                volumeControler.value = 0.1;
            }
            selectedSound.volume = volumeControler.value;
            selectedSound.play();
            soundImage.classList.add("playing");
        } else {
            volumeControler.style.opacity = 0;
            selectedSound.pause();
            selectedSound.currentTime = 0;
            volumeControler.value = 0;
            soundImage.classList.remove("playing");
        }
        console.log(event.target.type);
        console.log(selectedSound);
    }

    // Controlling volume of the sounds
    function volumeSound(e) {
        if (is_muted) {
            muteDocument();
        }
        var targetElement = e.target || e.srcElement;
        var vol = targetElement.value;
        var selectedSound = targetElement.parentElement.querySelector('audio');
        selectedSound.volume = vol;
    }

    var playing_sounds = [];

    function muteDocument() {
        if (!is_muted) {
            playing_sounds.length = 0;
            is_muted = true;
            document.querySelector('.unmuted').style.display = "none";
            document.querySelector('.muted').style.display = "inline";
            var all_audio = document.querySelectorAll('audio');
            for (var i = 0; i < all_audio.length; i++) {
                if (!all_audio[i].paused) {
                    playing_sounds.push([all_audio[i], all_audio[i].volume]);
                }
            }
            playing_sounds.forEach(function (sound) {
                sound[0].volume = 0;
            });
        } else {
            is_muted = false;
            document.querySelector('.unmuted').style.display = "inline";
            document.querySelector('.muted').style.display = "none";
            playing_sounds.forEach(function (sound) {
                sound[0].volume = sound[1];
            });
        }
    }

    function resetSounds() {
        var all_audio = document.querySelectorAll('audio');
        for (var i = 0; i < all_audio.length; i++) {
            all_audio[i].pause();
            all_audio[i].currentTime = 0;
            all_audio[i].value = 0;
        }
        var all_play_btns = document.querySelectorAll('.start_btn img');
        for (var i = 0; i < all_play_btns.length; i++) {
            all_play_btns[i].classList.remove("playing");
        }
        var all_volume_control = document.querySelectorAll('.volume_bar');
        for (var i = 0; i < all_volume_control.length; i++) {
            all_volume_control[i].value = 0;
            all_volume_control[i].style.opacity = 0;
        }
    }

    //-->
</script>


<span id="playFix"></span>
<script type="text/javascript">
    <!--
    var soundPlay = "<audio autoplay loop><source src=\"//onlineclock.net/audio/silence.mp3\" type=\"audio/mpeg\"></audio>";

    function makeSilentAgainOrig() {
        document.getElementById("playFix").innerHTML = "";
    }

    function playQuietlyOrig() {
        document.getElementById("playFix").innerHTML = soundPlay;
        setTimeout(makeSilentAgainOrig, 11000);
    }

    -->
</script>

<link rel="prefetch" href="//onlineclock.net/audio/alarm2.mp3">
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.0/howler.core.min.js"></script>
<script type="text/javascript">
    var sound = new Howl({
        src: ['https://onlineclock.net/audio/alarm2.mp3'],
        format: ['mp3'],
        loop: true,
        volume: 1.0
    });

    function playAlarm() {
        var alarmDivHTML = "<div id=\"alarmPlayingDiv\" style=\"display:block\"><p><br><br></p><center>";
        alarmDivHTML = alarmDivHTML + "<a href=\"//onlineclock.net/noisegenerator/off.html\" style=\"text-decoration:none;\" title=\"Click to turn Alarm OFF !\"><div style=\"font-size:24px;font-weight:700;background-color:#ff0000;color:#000000;padding:24px;\"><br>ALARM OFF</div></a>";
        alarmDivHTML = alarmDivHTML + "</center></div>";
        //if statement here necessary or alarm comes too early & will not play when alarm time set to NOW
        if (document.thisForm.alarm_hour.value !== "") {
            //hide the clock
            //$('#noiseGenDiv').hide();
            //noiseGenDiv.style.display = "none";
            document.getElementById("noiseGenDiv").innerHTML = alarmDivHTML;
            //howler:
            //check to make sure alarm not already playing or it sounds ugly!
            if (sound.playing() == false) {
                sound.play();
            }
            //show the 'alarm' banner
            //$('#alarmPlayingDiv').show();
            //alarmPlayingDiv.style.display = "block";
        }
    }

    //]]>
</script>

<script>
    window.ga = window.ga || function () {
        (ga.q = ga.q || []).push(arguments)
    };
    ga.l = +new Date;
    ga('create', 'UA-477189-6', 'auto');
    ga('set', 'anonymizeIp', true);
    ga('send', 'pageview');
</script>

</BODY>
</HTML>